$Core.resetSurveyForm = function() {		
	$("#question").val("");
	$("#title").val("");		
	$("#core_js_messages").empty();	
	$("input[name=\"image[]\"]").val("");
        
};
$Core.surveyAdded = function(id){
    $("#question").val("");
    $("#title").val("");		
    $("#core_js_messages").empty();	
    $("input[name=\"image[]\"]").val("");
    $.ajaxCall('survey.appendSurvey','id='+id);
}
$Behavior.setupSurveyIndex = function () {
		
	/*END. setup activity_feed_submit button */
	var attachmentType = $("#attachment-type");
	var attachmentImage = $("#attachment-image");
	var attachmentMusic = $("#attachment-music");
	$("#attach-music").click(function () {
		var $this = $(this);
		$(".attachment-item").hide();
		$(".attachment").hide();
		var bkClass = $this.attr("class");
		$this.closest("ul").find(".attachment-active").removeClass("attachment-active");
		$this.attr("class", bkClass);
		if($this.hasClass("attachment-active")) {
			$this.removeClass("attachment-active");
			attachmentMusic.hide();
		} else {
			$this.addClass("attachment-active");
			attachmentType.val("music");
			attachmentMusic.show();
			$(".attachment").show();
		}
	});
	$("#attach-image").click(function () {
		var $this = $(this);
		$(".attachment-item").hide();
		$(".attachment").hide();
		var bkClass = $this.attr("class");
		$this.closest("ul").find(".attachment-active").removeClass("attachment-active");
		$this.attr("class", bkClass);
		if($this.hasClass("attachment-active")) {
			$this.removeClass("attachment-active");
			attachmentType.val("none");
		} else {
			$this.addClass("attachment-active");
			attachmentType.val("image");
			attachmentImage.show();
			$(".attachment").show();
		}
	});
	$("#js_activity_feed_form").submit(function(evt) {
		if($("#title").val() == "Write a topic title...") {
			$("#title").val("")
		}
		if($("#question").val() == "Type the question want to survey...") {
			$("#question").val("")
		}
	});
	if($("#title").val() == "") {
		$("#title").val("Write a topic title...");
	}
	if($("#question").val() == "") {
		$("#question").val("Type the question want to survey...");
	}
	$("#title").focus(function() {
		if($("#title").val() == "Write a topic title...") {
			$("#title").val("");
		}
	});
	$("#question").focus(function() {
		if($("#question").val() == "Type the question want to survey...") {
			$("#question").val("");
		}
	});
	$("#title").blur(function() {
		if($("#title").val() == "") {
			$("#title").val("Write a topic title...");
		}
	});
	$("#question").blur(function() {
		if($("#question").val() == "") {
			$("#question").val("Type the question want to survey...");
		}
	});
	
	$(".comment-wrapper").each(function() {
		$(this).find(".comment-detail:last").find(".liner").remove();;
	});
}